var UserAdmin = {
	Initial : function(){
		$("a._deleteuser").bind("click",function(evt){
			if(!confirm("确定要删除该用户吗？"))
				evt.preventDefault();
		});
		for(var i=0;i<rids.length;i++){
			var rid = rids[i].rid;
			var uid = rids[i].uid;
			if(rid == 1){
				$("#useradmin" + uid).attr("checked",true);
			}
			else if(rid == 2){
				$("#addproduct" + uid).attr("checked",true);
			}
			else if(rid == 3){
				$("#addtype" + uid).attr("checked",true);
			}
			else if(rid == 4){
				$("#modifytype" + uid).attr("checked",true);
			}
			else if(rid == 5){
				$("#deletetype" + uid).attr("checked",true);
			}
			else{
				var pid = Math.floor(rid / 10);
				var add = rid % 10;
				if(pid > 0){
					if(add == 0){
						$("#viewproduct"+pid + "_" + uid).attr("checked",true);
					}
					else if(add == 1){
						$("#modifyproduct"+pid + "_" + uid).attr("checked",true);
					}
					else if(add == 2){
						$("#deleteproduct"+pid + "_" + uid).attr("checked",true);
					}
				}
			}
		}
		$("div.bodyright").find("input[@type=checkbox]").attr("disabled",true);
	}
};
$(UserAdmin.Initial);